------------------------------------------------------------------------------------------------
CONSOLE BINDINGS
------------------------------------------------------------------------------------------------
consolePrint(text)
consolePerformCommand(text)
consoleGetVariable(text)


------------------------------------------------------------------------------------------------
WIDGET/MENU BINDINGS
------------------------------------------------------------------------------------------------
-- We register a widget by defining a global table of the name of the widget, and providing that AS A STRING to registerWidget()
registerWidget(widgetname)
-- menu control
isInMenu()
hideMenu()
-- show/hide the active popup
showAsPopup(widgetname, [optional] p1, [optional] p2, [optional] p3, [optional] p4)
hidePopup()
callWidgetDrawOptions(widgetname, x, y, intensity)
callWidgetGetOptionsHeight(widgetname)
saveUserData(object)
loadUserData()
widgetCreateConsoleVariable(varname, vartype (int, float, string), defaultvalue)
widgetGetConsoleVariable(varname)
widgetSetConsoleVariable(varname, value)


------------------------------------------------------------------------------------------------
INPUT BINDINGS
------------------------------------------------------------------------------------------------
-- Defines a persistent mouse/key region, returns a table of mouse/key information
-- (contextid helps distinquish between different regions, will only be required if callstack looks identical from multiple calls -e.g for loop create regions
mouseRegion(x, y, w, h, [optional] contextid)
inputGrabRegion(x, y, w, h, [optional] contextid)
textRegion(x, y, w, h, initialString, [optional] contextid, [optional] giveFocus)
-- (id here is the id in the table returned by textRegion()
textRegionSetCursor(id, cursor index, [optional] drag select)
sayRegion()
sayPartyRegion([optional] giveFocus)


------------------------------------------------------------------------------------------------
NANOVG BINDINGS
------------------------------------------------------------------------------------------------
-- We use the NanoVG library for vector graphics.

-- State
nvgSave()
nvgRestore()

-- Font
nvgFontSize(size)
nvgFontFace(fontname)
nvgFontBlur(amount)
nvgTextLetterSpacing(spacing)
nvgTextWidth(text)
-- nvgTextBounds() returns table { minx, miny, maxx, maxy }
nvgTextBounds(text)
nvgTextBoxBounds(breakRowWidth, text)
nvgTextLineHeight(height)

-- Fill
nvgFillColor(color)
nvgFillLinearGradient(startx, starty, endx, endy, startcol, endcol)
nvgFillBoxGradient(x, y, w, h, rad, f, incol, outcol)
nvgFillRadialGradient(cx, cy, in_rad, out_rad, in_col, out_col)
nvgFillImagePattern(imageName, ox, oy, ex, ey, [optional] angle, [optional] alpha)
nvgFill()

-- Stroke
nvgStrokeColor(col)
nvgStrokeLinearGradient(startx, starty, endx, endy, startcol, endcol)
nvgStrokeBoxGradient(x, y, w, h, r, f, incol, outcol)
nvgStrokeRadialGradient(cx, cy, in_rad, out_rad, in_col, out_col)
nvgStrokeWidth(width)
nvgLineCap(cap (eg NVG_SQUARE))
nvgLineJoin(join (eg NVG_SQUARE))
nvgMiterLimit(limit)
nvgGlobalAlpha(alpha)
nvgStroke()

-- Text
nvgTextAlign(vert, horiz)
nvgText(x, y, text)
nvgTextBox(x, y, breakRowWidth, text)

-- Paths
nvgBeginPath()
nvgMoveTo(x, y)
nvgLineTo(x, y)
nvgBezierTo(c1x, c1y, c2x, c2y, x, y)
nvgQuadTo(cx, cy, x, y)
nvgArcTo(x1, y1, x2, y2, r)
nvgClosePath()
nvgPathWinding(NVG_HOLE / NVG_SOLID)

-- Primitives
nvgArc(cx, cy, r, a0, a1, dir)
nvgRect(x, y, w, h)
nvgRoundedRect(x, y, w, h, r)
nvgEllipse(x, y, rx, ry)
nvgCircle(x, y, r)

-- Scissoring
nvgScissor(x, y, w, h)
nvgIntersectScissor(x, y, w, h)
nvgResetScissor()

-- Transform
nvgTranslate(x, y)
nvgRotate(radians)
nvgSkewX(radians)
nvgSkewY(radians)
nvgScale(x, y)

------------------------------------------------------------------------------------------------
SVG BINDINGS
------------------------------------------------------------------------------------------------
nvgSvg(name, x, y, rad, [optional] blur)


------------------------------------------------------------------------------------------------
SERVERLIST BINDINGS
------------------------------------------------------------------------------------------------
serverListRefresh([optional] mmServersCanWatchOnly)
serverListCancel()
serverQueryPlayerList(address)
serverIsQueryingPlayerList()
serverQueryRuleList(address)
serverIsQueryingRuleList()


------------------------------------------------------------------------------------------------
MISC BINDINGS
------------------------------------------------------------------------------------------------
mapListRefresh([optional] tags)
require()
playSound()
playAnnouncer([optional] interrupt)
-- bindReverseLookup('+forward, game') returns 'W', if nothiing bound to it, it will return '(unbound)'
bindReverseLookup(command, [optional] state)
-- launchUrl('url') white-lists valid URLs internally
launchUrl(name)
-- launchGameOverlayToUser('dialog', 'steamid'), dialog = {"steamid", "chat", "jointrade", "stats", "achievements", "friendadd", "friendremove", "friendrequestaccept", "friendrequestignore" }
launchGameOverlayToUser(dialog, steamid)


------------------------------------------------------------------------------------------------
INVENTORY
------------------------------------------------------------------------------------------------
inventoryPurchase(definitionId)
inventoryRefresh()
inventoryExchange(definitionId)
inventoryIsExchanging()


------------------------------------------------------------------------------------------------
MOUSE BINDINGS
------------------------------------------------------------------------------------------------
-- mouseGetAverageRawInput() gets the average raw input for the previous client frame
mouseGetAverageRawInput(x, y)
mouseEvaluateSensitivity(x, y)


------------------------------------------------------------------------------------------------
PLAYER PREVIEW (seen in profile menu screen)
------------------------------------------------------------------------------------------------
playerPreviewSetEnabled(bool enabled)
playerPreviewSetRotation(degrees)
playerPreviewSetHoverColor1(colorIndex)
playerPreviewSetHoverColor2(colorIndex)
playerPreviewSetHoverColor3(colorIndex)
playerPreviewSetHoverInventory(slot, defId)


------------------------------------------------------------------------------------------------
WORKSHOP
------------------------------------------------------------------------------------------------
workshopQueryLocalUserMaps(list type, [optional] page, [optional] { tags })
workshopQuerySpecificMaps({ ids })
workshopQueryAllMaps(search type, [optional] search text, [optional] page, [optional] { tags })
workshopIsQueryingMaps()

-- these functions work in isolation of the above, so they can be used to query authors for scoreboard of callvote dialog etc..
workshopQuerySpecificMap(id)
workshopIsQueryingSpecificMap(id)
workshopCreateMap(create a new empty workshop item)
workshopIsCreatingMap()
-- workshopIsUpdating() returns bool: updating, number: percent, string: status
-- workshopGetUpdateMapResult() returns bool: success, string: reason, bool: need legal
workshopUpdateMap(id, visibility, [optional] changelog)
workshopIsUpdatingMap(get status of current update)
workshopGetUpdateMapResult(get result of previous update)


-- these functions work on both workshop maps & addons, not renaming for legacy reasons
workshopGetMapFlags(returns vote up, vote down, fav, sub)
workshopSetMapVote()
workshopSetMapFavorite()
workshopSetMapSubscibed()


workshopUploadAddon(id, visibility, description, [optional] changelog)
workshopIsUploadingAddon(get status of current update)
workshopGetUploadAddonResult(get result of previous update)
workshopDeleteAddon(folder)
workshopDownloadAddon(id, name)


------------------------------------------------------------------------------------------------
MAP EDITOR
------------------------------------------------------------------------------------------------
-- meGetPrefabList() returns { { name = 'rock', refCount = 1 }, { name = 'block', refCount = 5 }, .... }
meGetPrefabList()


------------------------------------------------------------------------------------------------
LEADERBOARDS
------------------------------------------------------------------------------------------------
leaderboardsRequestUsers(mapName, gameModeShortName, { steamids })
leaderboardsRequestGlobal(mapName, gameModeShortName, [optional] type)
------------------------------------------------------------------------------------------------
MATCHMAKING
------------------------------------------------------------------------------------------------
matchmakingSetReady()
matchmakingSetVoteMapPick(mapIndex)
matchmakingSetVoteMapDrop(mapIndex)
matchmakingUpdateMmr()
matchmakingUpdateTurboTime()
matchmakingUpdateRegionPings()
------------------------------------------------------------------------------------------------
PARTY
------------------------------------------------------------------------------------------------
partyLeave()
partyInvitePopup()
partyInvite(steamId)


